package com.ruoyi.common.log.config;

import com.zaxxer.hikari.HikariDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
     public class
DataSourceConfig {
         @Bean
         public DataSource dataSource() {

             // 创建并配置数据源对象，这里以 HikariCP 数据源为例
             HikariDataSource dataSource = new HikariDataSource();
             dataSource.setJdbcUrl("jdbc:mysql://10.39.7.79:3306/ry-gate?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8");
             dataSource.setUsername("root");
             dataSource.setPassword("123456");
             return dataSource;
         }
     }